<template>
    <div>
    <el-dialog
      id="dialog-customer-edit"
      title="编辑客户"
      :visible.sync="dialogshow"
      :before-close="dialogClose"
      style="display: none"
      top="10vh"
      width="90%"
      :fullscreen="fullscreen"
    >
      <dialog-tools
        v-bind:back="true"
        v-bind:next="true"
        v-bind:goback="true"
        v-bind:prev="true"
        v-bind:screen="true"
        @clickfullscreen="clickfullscreen"
      >
      </dialog-tools>
      <el-form
            id="pricesManages"
            size="mini"
            :model="customer"
            label-width="100px"
      >
        <el-form-item label="客户名称" :required="true">
          <el-input
            v-model="customerEditForm.name"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="客户代码" :required="true">
          <el-input
            v-model="customerEditForm.name"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="客户状态" :required="true">
          <el-select v-model="customerEditForm.status" placeholder="请选择">
            <el-option label="合作中" value="A"></el-option>
            <el-option label="未合作" value="B"></el-option>
            <el-option label="中断" value="C"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="客户类别" :required="true">
          <el-select v-model="customerEditForm.type" placeholder="请选择">
            <el-option label="A类" value="A"></el-option>
            <el-option label="B类" value="B"></el-option>
            <el-option label="C类" value="C"></el-option>
            <el-option label="D类" value="D"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="业务联系人1" :required="true">
          <el-input
            v-model="customerEditForm.capital"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="业务电话" :required="true">
          <el-input
            v-model="customerEditForm.capital"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="业务微信">
          <el-input
            v-model="customerEditForm.tel"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="业务邮箱">
          <el-input
            v-model="customerEditForm.tel"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-row
          ><el-button size="mini" style="margin-left: 120px"
            >增加联系人</el-button
          ></el-row
        >
        <el-form-item label="客户来源">
          <el-input
            v-model="customerEditForm.bank"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="客户需求">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="法人">
          <el-input
            v-model="customer.certificateno"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="法人电话 	">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="业务邮箱">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="传真">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="信用等级">
          <el-select v-model="customerEditForm.xydj" placeholder="请选择">
            <el-option label="A级" value="A"></el-option>
            <el-option label="B级" value="B"></el-option>
            <el-option label="C级" value="C"></el-option>
            <el-option label="D级" value="D"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="授信额度">
          <el-select v-model="customerEditForm.sxed" placeholder="请选择">
            <el-option label="0" value="0"></el-option>
            <el-option label="1.8万" value="A"></el-option>
            <el-option label="2.5万" value="B"></el-option>
            <el-option label="3.3万" value="C"></el-option>
            <el-option label="4.0万" value="D"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="注册资金">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="年销售额">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="开户银行">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="对公银行账号">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>

        <el-form-item label="税务登记证号">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="经营面积">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>

        <el-form-item label="授权品牌">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="注册商标">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="网址">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="创建人">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
            :disabled="true"
          ></el-input>
        </el-form-item>
        <el-form-item label="创建时间">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
            :disabled="true"
          ></el-input>
        </el-form-item>
        <el-form-item label="更新时间">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
            :disabled="true"
          ></el-input>
        </el-form-item>
        <el-form-item label="联系地址" style="width: 100%; clear: both">
          <el-input
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="备注" style="width: 100%; clear: both">
          <el-input
            type="textarea"
            v-model="customerEditForm.address"
            auto-complete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="附件" style="width: 100%; clear: both">
          <el-upload
            style="margin-left: 0px"
            class="upload-demo"
            action="https://jsonplaceholder.typicode.com/posts/"
            multiple
            :limit="3"
          >
            <el-button size="small" type="primary">上传</el-button>
            <div slot="tip" class="el-upload__tip">
              只能上传jpg/png文件，且不超过500kb
            </div>
          </el-upload>
        </el-form-item>
      </el-form>

      <div slot="footer" class="dialog-footer">

        <!-- <el-button
          style="float: left; margin-left: 50px"
          @click="dialogCustomerEditLog = true"
          >操作记录（3）</el-button
        > -->
        <!-- <el-button>重置</el-button> -->
        <el-button @click="dialogClose">取 消</el-button>
        <el-button type="primary" @click="alertopen">确 定</el-button>
        <!-- <el-button type="danger" @click="alertopen">删 除</el-button> -->
      </div>
    </el-dialog>
    </div>
</template>
<style scoped>
	.td-lable,
	.td-info {
		display: inline-table;
		vertical-align: -webkit-baseline-middle;
	}

	.td-lable {
		text-align: right;
		width: 100px;
	}

	.td-info {
		margin-left: 20px;
	}
	.tabs-table td {
		height: 50px;
		border-bottom: 1px solid #dcdfe6;
	}
    .customer-tabs .el-tab-pane{
	height:400px;
	overflow: auto;
	padding:20px;
	}

</style>
<script>
  module.exports = {
    methods:{
      dialogAdd(){
        this.$confirm('是否继续操作?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$message({
            type: 'success',
            message: '操作成功!'
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          })
        })
      },
      dialogClose(){
        this.$emit('dialog_close',1)
      },
      clickfullscreen () {
        this.fullscreen = !this.fullscreen
      },
      //跟进
      dialog_close_genjin_add (val) {
        console.log(val)
        this.dialogGenjiAdd = false
      },
      //跟进
      dialog_close_customer_edit (val) {
        console.log(val)
        this.dialogCustomerEdit = false
      },
      handleButtons (val) {
        console.log(2222)
        switch (val) {
          case 1:
            this.dialogSendMessage = 'true'
            console.log(this.dialogSendMessage)
            break

          case 10:
            console.log(333)
            this.dialogCustomerInfo = 'false'
            this.dialogGenjiAdd = 'true'
            console.log(this.dialogGenjiAdd)
            break

        }
      },
    },
    props: ['dialogshow'],
    data (){
      return {
        activeName:'first',
        dialogSendMessage:false,
        dialogCustomerInfo:false,
        dialogGenjiAdd:false,
        fullscreen: false,
        Sendmssages:{
          address:'',
          customercate:'',
          cate:'',
          nickname:'',
          creditrank:'',
          name:'',
        },
              customerEditForm: {
        name: "某珠宝公司",
        six: "",
        type: "",
        tel: "",
        mobile: "",
        remark: "",
      },
        customerstaffs:[
          { typename: '员工一' },
          { typename: '员工二' },
          { typename: '员工三' },
          { typename: '员工四' },
        ],
        changeReason:[
          { typename: '原因一' },
          { typename: '原因二' },
          { typename: '原因三' },
          { typename: '原因四' },
        ],
        pickerOptions: {
          shortcuts: [{
            text: '今天',
            onClick(picker) {
              picker.$emit('pick', new Date());
            }
          }, {
            text: '昨天',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24);
              picker.$emit('pick', date);
            }
          }, {
            text: '一周前',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', date);
            }
          }]
        },
        customer: {
          name: '',
          customercode: '',
          customerstatus: '',
          customercate: '',
          creditrank: '',
          creditline: '',
          capital: '',
          annualsales: '',
          bank: '',
          certificateno: '',
          address: '',
          area: '',
          brand: '',
          bankaccount: '',
          trademark: '',
          website: '',
          lperson: '',
          lphone: '',
          contacts: '',

          phone: '',
          phonenum: '',
          weixin: '',
          email: '',
          fax: '',
          resource: '',
          requirement: '',
          ordercountmonth: '',
          purchaseamountmonth: '',
          ordercountyear: '',
          purchaseamountyear: '',
          customerstaffname: '',
          customerstaffcode: '',
          operator: '',
          insertime: '',
          remark: '',
        },
        crmsclientStatic: [
          { typename: 'A级' },
          { typename: 'B级' },
          { typename: 'C级' },
          { typename: 'D级' },
        ],

        scheduleType: [
          { typename: '业务拓展' },
          { typename: '订单跟进' },
          { typename: '料/款跟进' },
        ],

        cates: [
          { typename: '意向客户' },
          { typename: '老客户' },
        ],

        crmsclientRank: [
          { typename: 'A类' },
          { typename: 'B类' },
          { typename: 'C类' },
          { typename: 'D类' },
        ],
        
      }
    },
    components:{
      'dialog-tools': 'url:../tools/dialog-tools.vue',
    }
  }
</script>
